<template>
  <div>
    <el-container>
      <el-header style="background-color: gray">
       
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            :router="true"
          >
            <el-submenu              
               v-for="item in Data"
              :index="item.MeNuInfoId"
              :key="item.MeNuInfoId"
            >
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>{{ item.MeNuInfoName }}</span>
              </template>
              <el-menu-item-group>
                <template slot="title"></template>
                <el-menu-item
                  :index="item.MeNuInfoPath"
                  v-for="item in item.child"
                  :key="item.MeNuInfoId"
                  >{{ item.MeNuInfoName }}</el-menu-item
                >
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main><router-view></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import axios from "../util/axios.js";
export default {
  data() {
    return {
      member: [],
      Data: [],
    };
  },

  methods: {
   
    getisLoad() {
      let userinfo = localStorage.getItem("userinfo");
      if (userinfo == null) {
        this.$message("未登录用户");
        this.$router.push({ name: "login" });
      }
    },
  
    onlist(){
      console.log(1111111111);
      axios.get("api/Menu/GetTress").then((res)=>{
        this.Data=res.data.Data;
      })
    }
  },
  created() {
    this.getisLoad();
    
    this.onlist();
   
  },
};
</script>
<style>
.el-aside {
  background-color: #333;
  color: #333;
  text-align: center;
  height: calc(100vh - 100px);
}
</style>